/***************************************
		�z�w�w�w�s�w�w�w�s�w�w�w�{
		�x 1 �x 2 �x 3 �x
		�u�w�w�w�q�w�w�w�q�w�w�w�t
		�x 4 �x   �x 6 �x
		�u�w�w�w�q�w�w�w�q�w�w�w�t
		�x 7 �x 8 �x 9 �x
		�|�w�w�w�r�w�w�w�r�w�w�w�}
	
	  �z�w�w�w�w�{ �z�w�w�w�w�{
	  �x 12 �x �x 32 �x
	  �|�w�w�w�{�x �x�z�w�w�w�}
		�z�w�w�w�r�r�w�r�r�w�w�w�{
		�x           �x
		�|�w�w�w�s�s�w�s�s�w�w�w�}
		�z�w�w�w�}�x �x�|�w�w�w�{
	  �x 78 �x �x 98 �x
	  �|�w�w�w�w�} �|�w�w�w�w�}


Style :
	<option>cream</option>
	<option>light</option>
	<option>dark</option>
	<option>green</option>
	<option>red</option>
	<option>plain</option>	
	<option>blue</option>	
	<option>jtools</option>	
	<option>youtube</option>	
	<option>cluetip</option>	
	<option>tipsy</option>	
	<option>tipped</option>	
		
***************************************/
var _pTooltip;
var _pTarget;

/**
�]�w�E�x���V
**/
var showToolTip2 = function(id,text,style,direction){
	var n = parseInt(direction);
	switch(n){
		case 1:
			_pTooltip = "bottom right";
			_pTarget  = "top left";
			break;
		case 2:
			_pTooltip = "bottom middle";
			_pTarget  = "top middle";
			break;
		case 3:
			_pTooltip = "bottom left";
			_pTarget  = "top right";
			break;
		case 4:
			_pTooltip = "right middle";
			_pTarget  = "left middle";
			break;
		case 6:
			_pTooltip = "left middle";
			_pTarget  = "right middle";
			break;
		case 7:
			_pTooltip = "top right";
			_pTarget  = "bottom left";
			break;
		case 8:
			_pTooltip = "top middle";
			_pTarget  = "bottom middle";
			break;
		case 9:
			_pTooltip = "top left";
			_pTarget  = "bottom right";
			break;
		case 12:
			_pTooltip = "bottom right";
			_pTarget  = "top middle";
			break;
		case 32:
			_pTooltip = "bottom left";
			_pTarget  = "top middle";
			break;
		case 78:
			_pTooltip = "top right";
			_pTarget  = "bottom middle";
			break;
		case 98:
			_pTooltip = "top left";
			_pTarget  = "bottom middle";
			break;
	}
	_showToolTipV2(id,text,style,_pTooltip,_pTarget);
}


function _showToolTipV2(name,text,style,_pTooltip,_pTarget,hiddenTarget){
	$(name).qtip({
		//content: text,
		
		content: {
					text: text , 
					button: true
					/*
					title: {
						text: 'My ',
						button: true
					}
					*/
				},
		
		position: {
			my: _pTooltip,
			at: _pTarget,
			adjust: {
		         x: 10
		      }
			//target:'mouse'
		},
		show: {
			ready: true,
			event: false
		},
		/*
		hide: {
			when: {
				target: {
					attr: function (i){return self.removeTag+"$(this)."+name+"('"+i+"')"+self.removeTag},
					css: function (i){return self.removeTag+"$(this)."+name+"('"+i+"')"+self.removeTag}
				}
			},
			event: "click"
		},
		*/
		hide: {
      target: hiddenTarget,
      event: 'click'
   	},
		style: {
			tip: true,
			classes: "ui-tooltip-" + style
		}
	});
}